<template>
  <Participant :value="participant"
               :icon-name="iconName"
               :content="content"
               tag-class="from"
               tag-name="发" />
</template>

<script>
import OrderMixin from "@/components/order/order.mixin";
import Participant from "@/components/basic/Participant.vue";
export default {
  name: "OrderCustomer",
  components: { Participant },
  mixins: [OrderMixin],
  props: ["value"],
  computed: {
    participant () {
      const { customerName } = this.customer;
      const { contactName, contactMobile, city, province, district, address } = this.fromAddress;
      const additionals = [];
      if (this.fromTime) {
        additionals.push("发货时间: " + this.$moment(this.fromTime).format("YYYY-MM-DD HH:mm"));
      }

      return {
        contactName,
        contactMobile,
        name: customerName,
        city,
        province,
        district,
        address,
        additionals
      };
    },
    iconName () {
      return this.customerType === 0 ? 'xianxia' : ''
    },
    content () {
      return this.customerType === 0 ? '线下' : ''
    }
  }
};
</script>
